﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EasyTest;
namespace EtTest.MormonOrg.Pages
{
    public class MeetMormons
    {
        public static Page Page = new Page("Meet Mormons", PageFindBy.Element("html[data-urlkey='people-find']"));
        public static TextBox SearchText = new TextBox("filter_search", Page);
        public static class Genders
        {
            public static SelectOption Male = new SelectOption("#genders option[value='M']");
            public static SelectOption Female = new SelectOption("#genders option[value='F']");
        }
        public static Link List = new Link(".select-list", Page);
        public static Link Picture = new Link(".select-picture", Page);
        public static Button Search = new Button("search");
        public static ProfileResult Result(string name) {
            return new ProfileResult(name);
        }
    }
    public class ProfileResult:IElement
    {
        public static Link Link;
        public static Text Name;
        public static Text Description;
        public ProfileResult(string name)
        {
            FindBy="//li[@class='profile']//div[@class='desc']//p[text()='"+name+"']/ancestor::li[@class='profile']";
            Link = new Link(FindBy + "//a");
            Name = new Text(FindBy + "//div[@class='desc']//p[1]");
            Description = new Text(FindBy+"//div[@class='desc']//p[2]");
        }
    }
}
